{% extends "billing/layout.html" %}
{% block title %}
    Table
{% endblock %}
{% block content %}
    <div class="page-header">
        <h1>月度费用表格</h1>
        <a href="{% url 'billing:monthly' %}">返回图形输出</a>
    </div>

    <div id="ajax-table"></div>
{% endblock %}

{% load static %}
{% block script %}
<script>
    var tableDom = document.getElementById('ajax-table');

    $(function () {
        fetchData();
    });

    function fetchData() {
        $.ajax({
            type: "GET",
            url: "{% url 'billing:cost_table' %}",
            dataType: 'html',
            success: function (result) {
                tableDom.innerHTML = result;
            }
        });
    }
</script>
{% endblock %}
